package org.cy.peoplehill.server;

import java.util.ArrayList;
import java.util.Collection;

import org.cy.peoplehill.client.User;

class UserManager {
	private static UserManager userMgr;
	private Collection<User> userCol;
	private UserManager(){
		userCol = new ArrayList<User>();
	}

	public static final UserManager getManager(){
		if(userMgr==null)userMgr = new UserManager();
		return userMgr;
	}

	public void addUser(User user){
		userCol.add(user);
	}
	
	public void removeUser(User user){
		userCol.remove(user);
	}
	
	public boolean isExist(User user){
		for(User somebody:userCol){
			if(somebody.equals(user))return true;
		}
		return false;
	}
	
}
